package com.zhouyu.bean;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.stereotype.Component;

/**
 * @ClassName:CustomerBeanFactoryPostProcess
 * @Auther: xierongchang
 * @Description:
 * @Date: 2024/6/20 16:31
 * @Version: v1.0.0
 */
@Component

public class CustomerBeanFactoryPostProcess implements BeanFactoryPostProcessor {

	public CustomerBeanFactoryPostProcess() {
		System.out.println("第1步：这是BeanFactoryPostProcessor(工厂后处理器)实现类CustomBeanFactoryPostProcessor的构造器！");
	}

	@Override
	public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
		System.out.println("第2步：调用BeanFactoryPostProcessor(工厂后处理器)实现类CustomBeanFactoryPostProcessor的方法postProcessBeanFactory。ApplicationContext容器初始化中refresh()中调用");
	}
}
